import os
import pytest
from tools.read_excel_range_as_list_of_dictionary import read_excel_range_as_list_of_dictionary
from tools.split_column import split_column
from tools.parse_class_time import parse_class_time

@pytest.mark.parametrize("input_range, split_column_name,expected_keys,expected_columns", [
    ("O10:Q12",'Q',['R','AA','AB'] ,['O', 'P','Q','R','AA','AB']),       # 两列两行

])
def test_split_column(input_range,split_column_name, expected_keys,expected_columns):
    file_path = os.path.join(os.path.dirname(__file__), "read_excel_range_as_list_of_dictionary_test_data.xlsx")
    sheet_name = "TestSheet"
    result = read_excel_range_as_list_of_dictionary(file_path, sheet_name,input_range)
    split_column(result,parse_class_time,split_column_name,expected_keys)
    assert list(result[0].keys()) == expected_columns

